Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: riscv64: use RISC-V SBI 2.0 ratified DBCN write instead of deprecated legacy console write #306

Merged
merged 1 commit into from
Mar 15, 2024

Conversation

luojia65
Copy link
Contributor

@luojia65 luojia65 commented Feb 28, 2024

Legacy extensions are deprecated in SBI 0.2 dated back to 2021; some of the SBI implementations have already dropped support for legacy console, resulting in no console output for hermit OS loader.

To solve this problem, we use its replacement in the SBI 2.0 DBCN extension, which is supported by modern SBI firmwares. We do this by modify our code to use the console_write_byte function from sbi-rt.

r? @mkroening

@mkroening mkroening self-requested a review February 28, 2024 08:23
@mkroening mkroening self-assigned this Feb 28, 2024
@luojia65
Copy link
Contributor Author

Oops, I forgot this fix. Squashed and re-commited.

Copy link
Member

@mkroening mkroening left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! This looks good.

Now we have no output on QEMU in CI, though. Do we have to change the QEMU command or just upgrade to a more recent QEMU?

@luojia65
Copy link
Contributor Author

@mkroening It looks like that older QEMU bundles with OpenSBI firmware that does not support latest SBI standard. I suspect if we can just try to upgrade QEMU, or we can use other SBI firmware (like RustSBI, by using '-bios /path/to/firmware') instead.

…cated legacy console write

Legacy extensions are deprecated in SBI 0.2 dated back to 2021;
some of the SBI implementations have already dropped support for legacy console, resulting in no console output for hermit OS loader.
To solve this problem, we use its replacement in the SBI 2.0 DBCN extension, which is supported by modern SBI firmwares. We do this by modify our code to use console_write_byte function from sbi-rt.

Signed-off-by: Zhouqi Jiang <[email protected]>
Copy link
Member

@mkroening mkroening left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I updated OpenSBI in #312.

RustSBI is certainly an interesting option as well!

@mkroening mkroening added this pull request to the merge queue Mar 15, 2024
Merged via the queue into hermit-os:main with commit 5abcf35 Mar 15, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants